<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="author" content="逯灿灿">
    <title>白条分期</title>
    <style>
    body{
        margin: 0;
    }
    .nav{
        display: flex;
        width: 800px;
        margin: 100px auto;
    }
    span{
        line-height: 45px;
    }
    ul{
        margin: 0;
        padding: 0;
        display: flex;
        list-style: none;
    }
    li{
        border: 1px solid gray;
        margin: 0 10px;
        padding: 5px;
        line-height: 35px;
    }
    .active{
        border: 1px solid red;
    }
    .active2{
        border: 1px solid red;
    }
    .message{
        width: 80px;
        height: 50px;
        background-color: green;
        line-height: 50px;
        margin: 150px auto;
        text-align: center;
        display: none;
    }
    .messageshow{
        display: block;
    }
    </style>
</head>

<body>
    <div class="nav">
        <span>白条分期</span>
        <ul>
            <li>不分期</li>
            <li>￥540x3期</li>
            <li>￥270x6期</li>
            <li>￥140x12期</li>
            <li>￥74x24期</li>
        </ul>
    </div>
    <div class="message">打白条</div>
    <script src="./js/jquery.js"></script>
</body>

</html>
<script>
    $('li').mouseover(function(){
        $(this).addClass('active2').siblings().removeClass('active2');
    });
    $('ul').on('click','li',function(){
        $(this).toggleClass('active').siblings().removeClass('active');
        if($(this).hasClass('active')){
            $('.message').addClass('messageshow');
        }else{
            $('.message').removeClass('messageshow');
        }
        
    });
</script>